import request from "@/api/index.js"

// 获取我的物品 type:0-下架 1-在售 2-全部
export function getMyGoodsApi(type, page, content) {
  return request({
    url: `/user/search-goods?type=${type}&page=${page}&content=${content}`,
    method: "get"
  })
}

// 删除物品
export function deleteGoodsApi(goodsId) {
  return request({
    url: "/IntactGoods?goodsId=" + goodsId,
    method: "delete"
  })
}

// 上架物品
export function putUpGoodsApi(goodsId) {
  return request({
    url: `/user/modifyMyGoods?goodsId=${goodsId}&type=1`,
    method: "put"
  })
}

// 下架物品
export function putDownGoodsApi(goodsId) {
  return request({
    url: `/user/modifyMyGoods?goodsId=${goodsId}&type=0`,
    method: "put"
  })
}
